<template>
    <h1>计数器</h1>
    <div>{{ store.count }}</div>
    <button @click="add">+</button>
    <button @click="addAsync">async+</button>
    <button @click="addNum(3)">+n</button>
</template>
<script lang='ts' setup>
import {useCounterStore} from '@/store/counter'
const store=useCounterStore()
const add=()=>store.increment()
const addAsync=()=>store.incrementAsyc()
const addNum=(n:number)=>store.incrementNum(n)
</script>
<style lang='scss' scoped>
</style>